#!/bin/sh

CUSER=${component.service.username}
CGROUP=${component.service.groupname}

if [ "$CUSER" = "" ] ; then
	CUSER=${USER_NAME}
	CGROUP=${GROUP_NAME}
fi

cd $INSTALL_PATH
mkdir -p html
chown -R $CUSER:$CGROUP "${INSTALL_PATH}"
find $PWD -type d -exec chmod -R 775 {} \;
chmod 775 *.sh
chmod 775 node

# init script
exit 0#!/bin/sh

# Start Syracuse Doc Server command line
cd "$INSTALL_PATH"
./node index.js
# ${UNINSTALL_NAME}
[Unit]
Description=${UNINSTALL_NAME}
After=network-online.target

[Service]
ExecStart=/bin/sh -c '"${INSTALL_PATH}/node" index.js'
WorkingDirectory=${INSTALL_PATH}
User=${component.service.username}

[Install]
WantedBy=multi-user.target graphical.target
#!/bin/sh

# you need to be root to launch this script !
SERVICE_NAME=`echo "${component.node.name}" | tr -d [:space:] | tr [:upper:] [:lower:]`

echo "Create service syracuse-doc-$SERVICE_NAME ..."
cp -f "${INSTALL_PATH}/syracuse-doc.service" /etc/systemd/system/syracuse-doc-$SERVICE_NAME.service
systemctl daemon-reload
systemctl enable syracuse-doc-$SERVICE_NAME
#!/bin/sh

# you need to be root to launch this script !
SERVICE_NAME=`echo "${component.node.name}" | tr -d [:space:] | tr [:upper:] [:lower:]`

systemctl disable syracuse-doc-$SERVICE_NAME
rm -f /etc/systemd/system/syracuse-doc-$SERVICE_NAME.service
systemctl daemon-reload

#!/bin/sh

# you need to be root to launch this script !
SERVICE_NAME=`echo "${component.node.name}" | tr -d [:space:] | tr [:upper:] [:lower:]`

echo "Start service $SERVICE_NAME ..."
systemctl start syracuse-doc-$SERVICE_NAME
sleep 1
echo "Service running on URL: http://${HOST_NAME}:${documentation.service.port}/ "

#!/bin/sh

# you need to be root to launch this script !
SERVICE_NAME=`echo "${component.node.name}" | tr -d [:space:] | tr [:upper:] [:lower:]`

systemctl stop syracuse-doc-$SERVICE_NAME
sleep 1
